{smcl}
{txt}{sf}{ul off}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}E:\Github\Bolivia\00_replication_files\log-files/2_Figure_A1.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}25 Jan 2022, 21:39:58
{txt}
{com}. 
. timer on 2
{txt}
{com}. 
. *------------*
. * Figure A.1 *
. *------------*
.         * Figure A.1.a
.         *-------------
.                 use "data/outputs/computo_ulttranstrepdate_nomissings.dta", clear
{txt}
{com}. 
.                 keep NumMesa trep_date_ulttrans pcs_so
{txt}
{com}.                 rename trep_date_ulttrans trep_date_ult_trans_date
{res}{txt}
{com}.                 rename pcs_so pcs_so_ult_trans_date
{res}{txt}
{com}. 
.                 tempfile ult
{txt}
{com}.                 save `ult'
{txt}file C:\Users\Nicolas\AppData\Local\Temp\ST_2420_000001.tmp saved

{com}. 
.                 * use data set with problem booths appended at the end
.                 use "data/outputs/computo_verificadortrepdate_nomissings.dta", clear
{txt}
{com}.                 keep NumMesa trep_date_verificador pcs_so trep_missing_date
{txt}
{com}. 
.                 * merge transmission times
.                 merge 1:1 NumMesa using `ult'
{res}
{txt}{col 5}Result{col 38}# of obs.
{col 5}{hline 41}
{col 5}not matched{col 30}{res}           1,134
{txt}{col 9}from master{col 30}{res}               0{txt}  (_merge==1)
{col 9}from using{col 30}{res}           1,134{txt}  (_merge==2)

{col 5}matched{col 30}{res}          33,044{txt}  (_merge==3)
{col 5}{hline 41}

{com}.                 drop _merge
{txt}
{com}.                 sort trep_date_verificador
{txt}
{com}. 
.                 * choose dates to label on x axis
.                 local x1 = clock("20oct2019 04:30:00","DMY hms")
{txt}
{com}.                 local x2 = clock("20oct2019 16:30:00","DMY hms")
{txt}
{com}.                 local x3 = clock("20oct2019 21:00:00","DMY hms")
{txt}
{com}.                 local x4 = clock("21oct2019 14:51:00","DMY hms")
{txt}
{com}.                 local x5 = clock("22oct2019 18:54:00","DMY hms")
{txt}
{com}. 
.                 drop pcs* trep_missing_date_verificador
{txt}
{com}. 
.                 * cdf, verified
.                 count if trep_date_verificador != .
  {res}33,044
{txt}
{com}.                 local nomiss = r(N)
{txt}
{com}.                 sort trep_date_verificador
{txt}
{com}.                 gen pcs_so = _n / `nomiss' if trep_date_verificador != .
{txt}(1,134 missing values generated)

{com}. 
.                 * cdf, transmitted
.                 count if trep_date_ult_trans_date != .
  {res}34,178
{txt}
{com}.                 local nomiss = r(N)
{txt}
{com}.                 sort trep_date_ult_trans_date
{txt}
{com}.                 gen pcs_so_ult = _n / `nomiss' if trep_date_ult_trans_date != .
{txt}
{com}. 
.                 * empirical densities
.                 twoway (kdensity trep_date_verificador, lcolor(gs6) lwidth(thick)) ///
>                         (kdensity trep_date_ult_trans_date, lcolor(midblue) lwidth(thick)), ///
>                         graphregion(color(white)) ylabel(, format(%12.1e) angle(0) labsize(small)) ///
>                         xlabel(`x1' `""10/20" "4:30am""' `x2' `""10/20" "4:30" "pm""' ///
>                         `x3' `""10/20" "9pm""' `x4' `""10/21" "2:51pm""' ///
>                         `x5' `""10/22" "6:54pm""', format(%tc) labsize(vsmall)) ///
>                         xtitle("Date and Time") legend(lab(1 "Verification Time") ///
>                                 lab(2 "Transmission Time") order(2 1) cols(1) pos(1) ring(0))
{res}{txt}
{com}.                 graph export "outputs/generated/Figure_A1a.pdf", replace
{txt}(file outputs/generated/Figure_A1a.pdf written in PDF format)

{com}. 
.         * Figure A.1.b
.         *-------------
.                 twoway (line pcs_so trep_date_verificador, ///
>                                         lcolor(gs6) lwidth(thick) sort) ///
>                         (scatter pcs_so_ult trep_date_ult_trans_date, ///
>                                 mcolor(midblue) msize(small)), ///
>                         graphregion(color(white)) ///
>                         ytitle("Percent of booths counted") ///
>                         xtitle("Date and Time") ///
>                         ylab(, angle(0)) ///
>                         xlabel(`x1' `""10/20" "4:30am""' `x2' `""10/20" "4:30" "pm""' ///
>                         `x3' `""10/20" "9pm""' `x4' `""10/21" "2:51pm""' ///
>                         `x5' `""10/22" "6:54pm""', format(%tc) labsize(vsmall)) ///
>                         legend(pos(4) ring(0) rows(2) order(2 "Transmission Time" ///
>                                 1 "Verification Time"))
{res}{txt}
{com}.                 graph export "outputs/generated/Figure_A1b.png", replace
{txt}(note: file outputs/generated/Figure_A1b.png not found)
(file outputs/generated/Figure_A1b.png written in PNG format)

{com}. 
. *------------------------------------------------------------------------------*
. timer off 2
{txt}
{com}. timer list 2
{res}   2:      1.57 /        1 =       1.5740
{txt}
{com}. 
. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}E:\Github\Bolivia\00_replication_files\log-files/2_Figure_A1.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}25 Jan 2022, 21:39:59
{txt}{.-}
{smcl}
{txt}{sf}{ul off}